﻿#pragma once
#include "PropertyProvider.h"

#include <models/ProjectDocument.h>

/// <summary>
/// PropertyManager
/// </summary>
class PropertyEntityProvider : public PropertyProvider
{
    Q_OBJECT

public:
    PropertyEntityProvider();

public:
    void initEditor(QtTreePropertyBrowser* editor);
    void valueChanged(QtProperty*, double) override;
    void valueChanged(QtProperty*, QString) override;
    void valueChanged(QtProperty*, int) override;
    void valueChanged(QtProperty*, bool) override;

    inline void setEntity(shared_ptr<ProjectDocument> entity)
    {
        entity_ = entity;
    }

private:
    void setupSignals();
private slots:
    void onSetSelectBoxInfo(int index, const vector<QRect>& rects);

private:
    shared_ptr<ProjectDocument> entity_;
};
